Uni-Verse Sound Redering protocol, URL and sound file formats

Author: Peter Lundn and Lauri Savioja
Version: 0.0.3
History:
	v0.0.3 2005-10-21 PLu, Changed Verse sound stream to verse audio stream and added verse audio buffer


URL schemes:
============

Verse audio streams:
-------------------
verse_as://verse.server.kth.se:45678/stream_node_1

Verse audio buffer:
-------------------
verse_ab://verse.server.kth.se:45678/buffer_node_1


Real time streaming protocol [RFC 2326]:
----------------------------------------

rtsp://rtp.streamer.tii.se:34567/thunder#channel=1,4-6

Fragments are not defined in the rtsp protocol, so thay must be 
handled by the player.

File scheme as defined in [RFC1738] fragment is not part of RFC1738:
--------------------------------------------------------------------

file://localhost/var/lib/snd/weather.snd#channel=4-6,9&begin=1h39'14.36739&end=1h42'39.78921&loop=true&duration=6'13.12


Attribute syntax
----------------

The attributes are inspired by SMIL 2.0
Streaming protocols only takes channel_attribute and duration attribute

attributes = attribute ["&" attributes]
attribute = channel_atrribute | begin_attribute | end_attribute | duration_attribute | loop_attribute 
channel_attribute = "channel" "= " channels ;defaults to 1-n, where n is the avalable number of channels in the player.
channels = channel ["," channels]*
channel = DIGIT+ ["-" DIGIT+]
begin_attribute = "begin" "=" time ;defaults to 0
end_attribute = "end" "=" time ;defaults to end of medium
loop_begin_attribute = " loop_begin" "=" time ;defaults to begin_attribute
loop_end _attribute = "loop_end" "=" time ; defaults to end_attribute
duration_attribute = "duration" "=" time ;defaults to end_attribute-begin_attribute
loop_attribute = "loop" "=" "true" | " false" ; defaults to false
time = [[hours "h"] minutes "'"] seconds ["." fraction]
hours = DIGIT+
minutes = DIGIT+, range from 00 to 59
seconds = DIGIT+, range from 00 to 59
fraction = DIGIT+
digits = DIGIT [ digits ]

Semantics:
==========

channel_attribute is a set of channels in the media to be used. The channels in the the player
   are mapped to the media channels as thay appears in the argument list, first argument is
   mapped to the first player channel or range of channels.

begin_attribute defines the position in the file to begin to play from

end_attribute defines the position in the file to stop playing

loop_begin_attribute defines the position to jump to when loop is wrapping.

loop_end _attribute defines the position where to jump back from if looping.

duration_attribute defines how long the sound clip should be playing,
   if duration is greater then end-begin then the sound must be looped.

loop_attribute define if the sound file should be looped.

Regular expression parsing:
==========================

URI: (ref: RFC 3986)
--------------------
^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?

   scheme    = $2
   authority = $4
   path      = $5
   query     = $7
   fragment  = $9

fragment parsing:
-----------------------------
The following regex will match the first attribute in a string, it does not validate the value.
^((channel|begin|end|duration|loop|loop_begin|loop_end)=([^&]+)(&.+|$))

   attribute_name  = $2
   attribute_value = $3

channels
--------
Pattern to verify syntax but does not parse (not possible with regex)
^((([0-9]+)(-([0-9]+))?)(,([0-9]+)(-([0-9])+)?)*)(&.+|$)

   channel_list =$1	

time
----
Pattern to validate and parse time.
^((([0-9]+)h)?(([0-9]+)'))?([0-9]+)(\.([0-9]+))?

   hour	     = $3
   minute    = $5
   second    = $6
   fraction  = $8

Supported sound file formats:
=============================
AIFF and AIFC
RIFF WAVE (.WAV)

some compressed audio should be supported (ogg mp3).

Standards referenced:
===================

URI RFC3987
rtsp scheme, real time streaming protocol [RFC2326]
file scheme [RFC1738]
